﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;

namespace _inherit
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] total = { 1, 2, 3,4, 5, 6, 7, 8 };
            ArrayList odd = new ArrayList();
            ArrayList even = new ArrayList();
            foreach(var x in total)
            {
                if(x%2!=0)
                {
                    odd.Add(x);
                }
                else
                {
                    even.Add(x);
                }
            }
            odd.AddRange(even);
            foreach(var x in odd)
            {
                Console.WriteLine(x);
            }
            Console.WriteLine("请输入一个字符串");
            string str1;
            str1 = Console.ReadLine();
            char[] str2 = str1.ToCharArray();
            Dictionary<char, int> test1 = new Dictionary<char, int>();
            foreach(var x in str2)
            {
                
                if(test1.ContainsKey(char.ToLower(x)))
                {
                    test1[char.ToLower(x)]++;
                }
                else
                {
                    test1.Add(char.ToLower(x), 1);
                }
            }
            foreach(var x in test1.Keys)
            {
                Console.WriteLine("键是{0}------值是{1}", x, test1[x]);
            }

  
       

        }
    }
}
